+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
+Tue Jul 31 22:59:33 2001 Tim Janik <timj@gtk.org>
+
+ * gtk/gtknotebook.c (gtk_notebook_get_child_property):
+ (gtk_notebook_set_child_property): fix finding of child's page,
+ since we have to validly deal with labels and menus here as well.
+ (gtk_notebook_get_child_property): fix warning.
+ (gtk_notebook_class_init): property tab_pack is of type
+ GTK_TYPE_PACK_TYPE (enum) not boolean.
+ (gtk_notebook_find_child): don't always warn, we might be looking
+ for a label or menu child.
+ (gtk_notebook_map): fix mapping of panel.
+
+ * gtk/gtkwidget.c (gtk_widget_set_child_visible): always constrain
+ widget's mapped state, regardless of the value being set equals
+ old settings, since things like REALIZED(parent) or MAPPED(parent)
+ may have changed since the old value was set. make it an error to
+ invoke this function on a toplevel widget.
+
2001-07-31 Darin Adler <darin@bentspoon.com>
* gdk/gdkprivate.h:
* tests/testgtk.c: gtk_accel_group_attach() takes a GObject.
Mon Jul 30 10:49:16 PDT 2001 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
* gtk/gtksignal.h (gtk_signal_handler_pending): corrected the wrong
argument order for g_signal_has_handler_pending.
#ifdef G_DISABLE_CHECKS
#define CHECK_FIND_CHILD(notebook, child) \
- gtk_notebook_find_child(notebook, child, \
- G_GNUC_PRETTY_FUNCTION)
+ gtk_notebook_find_child (notebook, child, G_STRLOC)
#else
#define CHECK_FIND_CHILD(notebook, child) \
- gtk_notebook_find_child(notebook, child, NULL)
+ gtk_notebook_find_child (notebook, child, NULL)
#endif
/*** GtkNotebook Methods ***/
static gint gtk_notebook_timer (GtkNotebook *notebook);
static gint gtk_notebook_page_compare (gconstpointer a,
gconstpointer b);
-static GList *gtk_notebook_find_child (GtkNotebook *notebook,
+static GList* gtk_notebook_find_child (GtkNotebook *notebook,
GtkWidget *child,
const gchar *function);
static gint gtk_notebook_real_page_position (GtkNotebook *notebook,
G_PARAM_READWRITE));
gtk_container_class_install_child_property (container_class,
CHILD_PROP_TAB_PACK,
- g_param_spec_boolean ("tab_pack", NULL, NULL,
- TRUE,
- G_PARAM_READWRITE));
+ g_param_spec_enum ("tab_pack", NULL, NULL,
+ GTK_TYPE_PACK_TYPE, GTK_PACK_START,
+ G_PARAM_READWRITE));
notebook_signals[SWITCH_PAGE] =
gtk_signal_new ("switch_page",
}
}
+ if (notebook->scrollable)
+ gdk_window_show (notebook->panel);
+
gdk_window_show (widget->window);
}
gboolean fill;
GtkPackType pack_type;
+ /* not finding child's page is valid for menus or labels */
+ if (!gtk_notebook_find_child (GTK_NOTEBOOK (container), child, NULL))
+ return;
+
switch (property_id)
{
case CHILD_PROP_TAB_LABEL:
notebook = GTK_NOTEBOOK (container);
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
+ /* not finding child's page is valid for menus or labels */
+ list = gtk_notebook_find_child (notebook, child, NULL);
+ if (!list)
{
- GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
+ /* nothing to set on labels or menus */
+ g_param_value_set_default (pspec, value);
return;
}
return (((GtkNotebookPage *) a)->child != b);
}
-static GList *
-gtk_notebook_find_child (GtkNotebook *notebook,
- GtkWidget *child,
- const gchar *function)
+static GList*
+gtk_notebook_find_child (GtkNotebook *notebook,
+ GtkWidget *child,
+ const gchar *function)
{
GList *list = g_list_find_custom (notebook->children, child,
gtk_notebook_page_compare);
#ifndef G_DISABLE_CHECKS
- if (!list)
- g_warning ("child argument to '%s' does not refer to the contents of a notebook page",
- function);
+ if (!list && function)
+ g_warning ("%s: unable to find child %p in notebook %p",
+ function, child, notebook);
#endif
return list;
gtk_notebook_menu_item_create (notebook,
g_list_find (notebook->children, page));
+ gtk_widget_set_parent (child, GTK_WIDGET (notebook));
+ if (tab_label)
+ gtk_widget_set_parent (tab_label, GTK_WIDGET (notebook));
+
gtk_notebook_update_labels (notebook);
if (!notebook->first_tab)
gtk_widget_hide (tab_label);
}
- gtk_widget_set_parent (child, GTK_WIDGET (notebook));
- if (tab_label)
- gtk_widget_set_parent (tab_label, GTK_WIDGET (notebook));
-
if (!notebook->cur_page)
{
gtk_notebook_switch_page (notebook, page, 0);
GList *list;
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
- g_return_val_if_fail (child != NULL, NULL);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
list = CHECK_FIND_CHILD (notebook, child);
if (!list)
GList *list;
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
list = CHECK_FIND_CHILD (notebook, child);
if (!list)
GList *list;
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
- g_return_val_if_fail (child != NULL, NULL);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
list = CHECK_FIND_CHILD (notebook, child);
if (!list)
GList *list;
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
list = CHECK_FIND_CHILD (notebook, child);
if (!list)
GList *list;
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
list = CHECK_FIND_CHILD (notebook, child);
if (!list)
GList *list;
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
list = CHECK_FIND_CHILD (notebook, child);
if (!list)
gtk_widget_set_child_visible (GtkWidget *widget,
gboolean is_visible)
{
- gboolean was_visible;
-
g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (!GTK_WIDGET_TOPLEVEL (widget));
- was_visible = GTK_WIDGET_CHILD_VISIBLE (widget);
- is_visible = is_visible != FALSE;
-
- if (is_visible != was_visible)
+ if (is_visible)
+ GTK_PRIVATE_SET_FLAG (widget, GTK_CHILD_VISIBLE);
+ else
+ GTK_PRIVATE_UNSET_FLAG (widget, GTK_CHILD_VISIBLE);
+ if (GTK_WIDGET_REALIZED (widget->parent))
{
- if (is_visible)
- {
- GTK_PRIVATE_SET_FLAG (widget, GTK_CHILD_VISIBLE);
-
- if (widget->parent &&
- GTK_WIDGET_VISIBLE (widget->parent) &&
- GTK_WIDGET_VISIBLE (widget))
- {
- if (GTK_WIDGET_MAPPED (widget->parent))
- gtk_widget_map (widget);
- }
- }
+ if (GTK_WIDGET_MAPPED (widget->parent) &&
+ GTK_WIDGET_CHILD_VISIBLE (widget) &&
+ GTK_WIDGET_VISIBLE (widget))
+ gtk_widget_map (widget);
else
- {
- GTK_PRIVATE_UNSET_FLAG (widget, GTK_CHILD_VISIBLE);
-
- if (GTK_WIDGET_MAPPED (widget))
- gtk_widget_unmap (widget);
- }
+ gtk_widget_unmap (widget);
}
}